package com.szrt.java.day20170109.demo03;

public class Student implements Comparable<Student> {
	
	
	@Override
	public int compareTo(Student o) {
		return  o.getAge() - this.getAge();
	}
	
	
	private String name;
	
	
	/**
	 * 为什么手机要用String
	 * 1 int   范围太小 不能装下手机号码
	 * 2 long  long手动写L
	 * 3 不需要对手机号码进行加减乘除的运算。
	 * 
	 */
	private String phone;
	
	
	private int age;


	public String getName() {
		return name;
	}


	public void setName(String name) {
		this.name = name;
	}


	public String getPhone() {
		return phone;
	}


	public void setPhone(String phone) {
		this.phone = phone;
	}


	public int getAge() {
		return age;
	}


	public void setAge(int age) {
		this.age = age;
	}


	@Override
	public String toString() {
		return "Student [name=" + name + ", phone=" + phone + ", age=" + age + "]";
	}


	
	
	
	
	
	

}
